/* import ItemLists from "@/pages/ItemLists";
import ItemAdd from "@/pages/ItemAdd";
import ItemUpdate from "@/pages/ItemUpdate";
import DashBoard from "@/pages/DashBoard";
import CateLists from "@/pages/CateLists";
import UserInfo from "@/pages/UserInfo";
import Setting from "@/pages/Setting"; */
import { lazy } from "react"
const ItemLists = lazy(() => import('@/pages/ItemLists'))
const ItemAdd = lazy(() => import('@/pages/ItemAdd'))
const ItemUpdate = lazy(() => import('@/pages/ItemUpdate'))
const DashBoard = lazy(() => import('@/pages/DashBoard'))
const CateLists = lazy(() => import('@/pages/CateLists'))
const UserInfo = lazy(() => import('@/pages/UserInfo'))
const Setting = lazy(() => import('@/pages/Setting'))
type routeConfig = {
  path: string,
  roles: string[],
  component: any
}
const routes: routeConfig[] = [
  {
    path: '/dashBoard',
    roles: ['*'],
    component: DashBoard
  },
  {
    path: '/itemLists',
    roles: ['admin','a', 'b'],
    component: ItemLists
  },
  {
    path: '/itemAdd',
    roles: ['admin','a', 'b'],
    component: ItemAdd
  },
  {
    path: '/itemUpdate',
    roles: ['admin','a', 'b'],
    component: ItemUpdate
  },
  {
    path: '/cateLists',
    roles: ['admin','a', 'b'],
    component: CateLists
  },
  {
    path: '/userInfo',
    roles: ['admin','a', 'b'],
    component: UserInfo
  },
  {
    path: '/setting',
    roles: ['a', 'b'],
    component: Setting
  }
]

export default routes